Skip to content

Fixes #27348: handle Pinot DOUBLE mapping across SQLAlchemy versions#27359

Merged
edg956 merged 8 commits intoopen-metadata:mainfrom
harishkotra:fix/pinot-double-sqlalchemy14
Apr 20, 2026
Merged

Fixes #27348: handle Pinot DOUBLE mapping across SQLAlchemy versions#27359
edg956 merged 8 commits intoopen-metadata:mainfrom
harishkotra:fix/pinot-double-sqlalchemy14

Conversation

@harishkotra
Copy link
Copy Markdown
Contributor

@harishkotra harishkotra commented Apr 14, 2026

Summary

  • fix Pinot type mapping to avoid types.DOUBLE hard dependency that breaks on SQLAlchemy 1.4
  • use a compatibility fallback chain: types.DOUBLE -> sqltypes.DOUBLE -> types.Float
  • update Pinot unit test expectation for double to allow SQLAlchemy-version-safe floating mapping while preventing integer regressions

Validation

  • ran targeted test:
    • ./.venv311/bin/python -m pytest ingestion/tests/unit/topology/database/test_pinotdb.py -q
  • result: 10 passed

Notes


Summary by Gitar

  • Feature inclusions:
    • The PR includes several unrelated commits merged into the branch, such as fix(search): scope alias lookups, feat(queryRunner): raise maxResultSize, and fix(domains): fix flaky Rename domain.
    • These changes appear to be side effects of merging main into the feature branch rather than the intent of the PR.

This will update automatically on new commits.

@harishkotra harishkotra requested a review from a team as a code owner April 14, 2026 14:19
Copilot AI review requested due to automatic review settings April 14, 2026 14:19
@github-actions
Copy link
Copy Markdown
Contributor

Hi there 👋 Thanks for your contribution!

The OpenMetadata team will review the PR shortly! Once it has been labeled as safe to test, the CI workflows
will start executing and we'll be able to make sure everything is working as expected.

Let us know if you need any help!

Comment thread ingestion/src/metadata/ingestion/source/database/pinotdb/metadata.py Outdated
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes Pinot column type mapping compatibility across SQLAlchemy 1.4 and 2.x by avoiding a hard dependency on sqlalchemy.types.DOUBLE, preventing runtime ingestion failures reported in #27348.

Changes:

  • Add a SQLAlchemy-version-safe fallback chain for Pinot "double": types.DOUBLEsqltypes.DOUBLEtypes.Float.
  • Update PinotDB unit tests to accept either DOUBLE or FLOAT for Pinot double, while guarding against integer regressions.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
ingestion/src/metadata/ingestion/source/database/pinotdb/metadata.py Uses a safe fallback for Pinot double mapping so ingestion won’t crash on SQLAlchemy 1.4.
ingestion/tests/unit/topology/database/test_pinotdb.py Adjusts test expectations for double mapping to be SQLAlchemy-version tolerant while preventing INT regressions.

Comment on lines 54 to 55
assert result in {"DOUBLE", "FLOAT"}
assert result != "INT", "Pinot DOUBLE is incorrectly mapped to INT"
Copy link

Copilot AI Apr 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The custom regression message for INT mapping will never be shown because the preceding assert result in {"DOUBLE", "FLOAT"} fails first when result == "INT". Consider asserting result != "INT" first (with the message) and then constraining the allowed floating types, or folding this into a single assertion so INT regressions produce the intended error output.

Suggested change
assert result in {"DOUBLE", "FLOAT"}
assert result != "INT", "Pinot DOUBLE is incorrectly mapped to INT"
assert result != "INT", "Pinot DOUBLE is incorrectly mapped to INT"
assert result in {"DOUBLE", "FLOAT"}

Copilot uses AI. Check for mistakes.
@edg956
Copy link
Copy Markdown
Contributor

edg956 commented Apr 14, 2026

Hi @harishkotra! Thank you for your contribution. The change looks good to me although I think the AI suggestions are both good. Could you please update your PR so I can trigger the CI?

@harishkotra
Copy link
Copy Markdown
Contributor Author

harishkotra commented Apr 14, 2026

Updated per feedback: applied both suggestions (moved DOUBLE fallback resolution to module level and adjusted assertion order in the regression test), then re-ran the targeted Pinot test (10 passed). Ready for CI trigger @edg956

@github-actions
Copy link
Copy Markdown
Contributor

Hi there 👋 Thanks for your contribution!

The OpenMetadata team will review the PR shortly! Once it has been labeled as safe to test, the CI workflows
will start executing and we'll be able to make sure everything is working as expected.

Let us know if you need any help!

@edg956 edg956 added the safe to test Add this label to run secure Github workflows on PRs label Apr 14, 2026
edg956
edg956 previously approved these changes Apr 14, 2026
@github-actions
Copy link
Copy Markdown
Contributor

The Python checkstyle failed.

Please run make py_format and py_format_check in the root of your repository and commit the changes to this PR.
You can also use pre-commit to automate the Python code formatting.

You can install the pre-commit hooks with make install_test precommit_install.

@edg956
Copy link
Copy Markdown
Contributor

edg956 commented Apr 14, 2026

The Python checkstyle failed.

Please run make py_format and py_format_check in the root of your repository and commit the changes to this PR. You can also use pre-commit to automate the Python code formatting.

You can install the pre-commit hooks with make install_test precommit_install.

@harishkotra could you please review this?

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 14, 2026

🟡 Playwright Results — all passed (15 flaky)

✅ 3672 passed · ❌ 0 failed · 🟡 15 flaky · ⏭️ 89 skipped

Shard Passed Failed Flaky Skipped
🟡 Shard 1 480 0 1 4
🟡 Shard 2 652 0 1 7
🟡 Shard 3 655 0 4 1
🟡 Shard 4 629 0 5 27
✅ Shard 5 611 0 0 42
🟡 Shard 6 645 0 4 8
🟡 15 flaky test(s) (passed on retry)
  • Pages/UserCreationWithPersona.spec.ts › Create user with persona and verify on profile (shard 1, 1 retry)
  • Features/BulkEditEntity.spec.ts › Glossary (shard 2, 1 retry)
  • Features/RestoreEntityInheritedFields.spec.ts › Validate restore with Inherited domain and data products assigned (shard 3, 2 retries)
  • Features/Table.spec.ts › Tags term should be consistent for search (shard 3, 1 retry)
  • Flow/PersonaDeletionUserProfile.spec.ts › User profile loads correctly before and after persona deletion (shard 3, 1 retry)
  • Flow/PersonaFlow.spec.ts › Set default persona for team should work properly (shard 3, 1 retry)
  • Pages/Customproperties-part2.spec.ts › entityReferenceList shows item count, scrollable list, no expand toggle (shard 4, 1 retry)
  • Pages/DataContracts.spec.ts › Create Data Contract and validate for Container (shard 4, 1 retry)
  • Pages/DataContracts.spec.ts › Create Data Contract and validate for Store Procedure (shard 4, 1 retry)
  • Pages/DataContracts.spec.ts › Create Data Contract and validate for Spreadsheet (shard 4, 1 retry)
  • Pages/Entity.spec.ts › Announcement create, edit & delete (shard 4, 1 retry)
  • Pages/Lineage/LineageFilters.spec.ts › Verify lineage schema filter selection (shard 6, 1 retry)
  • Pages/Lineage/LineageRightPanel.spec.ts › Verify custom properties tab IS visible for supported type: searchIndex (shard 6, 1 retry)
  • Pages/UserDetails.spec.ts › Create team with domain and verify visibility of inherited domain in user profile after team removal (shard 6, 1 retry)
  • Pages/Users.spec.ts › Permissions for table details page for Data Consumer (shard 6, 1 retry)

📦 Download artifacts

How to debug locally
# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip    # view trace

Copilot AI review requested due to automatic review settings April 16, 2026 07:29
@harishkotra
Copy link
Copy Markdown
Contributor Author

harishkotra commented Apr 16, 2026

Updated this PR per review feedback:

  • merged latest main into this branch (it was out-of-date)
  • ran make py_format
  • ran make py_format_check

Committed and pushed the formatting/base-sync updates @edg956

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

@edg956
Copy link
Copy Markdown
Contributor

edg956 commented Apr 17, 2026

@harishkotra there's some infrastructure flakiness in the pytest workflow I'm trying to get past by retrying and there is a playwright test broken from upstream I'm working on right now to unblock this PR

@edg956 edg956 added the To release Will cherry-pick this PR into the release branch label Apr 17, 2026
Copilot AI review requested due to automatic review settings April 17, 2026 16:30
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review is ineligible. To be eligible to request a review, you need a paid Copilot license, or your organization must enable Copilot code review.

@harishkotra
Copy link
Copy Markdown
Contributor Author

@harishkotra there's some infrastructure flakiness in the pytest workflow I'm trying to get past by retrying and there is a playwright test broken from upstream I'm working on right now to unblock this PR

Appreciate the reponse and thank you for the support.

@gitar-bot
Copy link
Copy Markdown

gitar-bot Bot commented Apr 20, 2026

Code Review ✅ Approved 1 resolved / 1 findings

Updates the Pinot DOUBLE mapping logic to resolve inconsistencies across SQLAlchemy versions by processing the type mapping per column. No further issues found.

✅ 1 resolved
Performance: double_type resolved inside function called per-column

📄 ingestion/src/metadata/ingestion/source/database/pinotdb/metadata.py:33-39
The double_type fallback chain (getattr(types, "DOUBLE", getattr(sqltypes, "DOUBLE", types.Float))) and the entire type_map dict are rebuilt on every call to get_type_custom, which is invoked once per column during schema introspection. Since the resolved type never changes at runtime, computing it once at module level would be cleaner and marginally faster.

This is a minor efficiency/readability nit — no correctness issue.

Options

Display: compact → Showing less information.

Comment with these commands to change:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Gitar

@sonarqubecloud
Copy link
Copy Markdown

@edg956
Copy link
Copy Markdown
Contributor

edg956 commented Apr 20, 2026

@harishkotra thank you for your contribution! Let me confirm whether this will make it to 1.12.6 or the next release

@github-actions
Copy link
Copy Markdown
Contributor

Failed to cherry-pick changes to the 1.12.6 branch.
Please cherry-pick the changes manually.
You can find more details here.

@harishkotra
Copy link
Copy Markdown
Contributor Author

@harishkotra thank you for your contribution! Let me confirm whether this will make it to 1.12.6 or the next release

Amazing! Absolutely delight to be contributing to this project. Thanks for all the support @edg956

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

safe to test Add this label to run secure Github workflows on PRs To release Will cherry-pick this PR into the release branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants